
#include"ork/tools.hpp"
#include"ork/log.hpp"
#include"file_ops.hpp"

using namespace ork;
using namespace xattr;
ORK_DEFAULT_LOGS(ST"./logs/error.log",ST"./logs/debug.log",ST"./logs/data.log")

ORK_MAIN{
	//std::string log_file("");
	//Call in daemon process
	//xattr::file::write_attribute_list(parser(log_file));
	const std::string file_name("./test.dat");
	const std::string attr_name("some_user");
	std::string val;

	bool test=xattr::file::read_attribute(file_name,attr_name,val);
	if(test)ORK_WRITE_MSG("File already existed, Value is "<<val)
	else ORK_WRITE_MSG("File did not exist");

	ork::ensure_directory(file_name);
	test=xattr::file::write_attribute(file_name,attr_name,"Tuesday");
	if(test)ORK_WRITE_MSG("Write successful")
	else ORK_WRITE_MSG("Write failed!");

	test=xattr::file::read_attribute(file_name,attr_name,val);
	if(test)ORK_WRITE_MSG("Read successful, Value is "<<val)
	else ORK_WRITE_MSG("Read failed!");

}

